package top.lixunda.ecommerce.server.user.api.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import top.lixunda.commerce.common.core.entity.MessageObject;
import top.lixunda.ecommerce.server.user.api.entity.dto.PermissionAllotDTO;

import java.util.List;

/**
 * 权限分配接口
 *
 * @author lixunda
 * @version time:2020/4/24 13:55
 */
@Api("权限分配接口")
@RequestMapping("/permission_allot")
public interface IPermissionAllotController {

    /**
     * 分配权限
     *
     * @param list 权限操作DTO
     * @return 是否保存成功
     */
    @ApiOperation("分配权限")
    @PostMapping("allotPermission")
    MessageObject<Boolean> allotPermission(@RequestBody List<PermissionAllotDTO> list);

    /**
     * 移除权限
     *
     * @param list 权限操作DTO
     * @return 是否移除成功
     */
    @ApiOperation("移除权限")
    @PostMapping("removePermission")
    MessageObject<Boolean> removePermission(@RequestBody List<PermissionAllotDTO> list);

    /**
     * 根据分配编号移除权限
     *
     * @param list 分配编号列表
     * @return 是否移除成功
     */
    @ApiOperation("根据分配编号移除权限")
    @PostMapping("removePermissionByIds")
    MessageObject<Boolean> removePermissionByIds(@RequestBody List<Integer> list);

}
